package com.hopu.v1.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

@Data
public class AttendanceVo {

    //学生姓名
    private String studentName;
    //班级名称
    private String className;
    //考勤规则id
    private Long regularId;
    //考勤规则上班时间
    @JsonFormat(pattern = "HH:mm:ss" , timezone = "GMT+8")
    @DateTimeFormat(pattern = "HH:mm:ss")
    private LocalDateTime startHours;
    //考勤规则下班卡时间
    @JsonFormat(pattern = "HH:mm:ss" , timezone = "GMT+8")
    @DateTimeFormat(pattern = "HH:mm:ss")
    private LocalDateTime endHours;
    //学生的考勤记录
    private List<AttendanceRecord> attendanceRecord;

    /**
     * 考勤记录实体
     */
    @Data
    private static class AttendanceRecord{
        //考勤日期
        private LocalDate attendanceDate;
        //考勤状态：1正常、2迟到、3早退、4迟到早退、5旷工、6请假
        private int status;
        //早打卡时间
        private LocalDateTime startClockIn;
        //晚打卡时间
        private LocalDateTime endClockIn;
    }
}
